package com.qf.shopping.controll;

import com.qf.shopping.pojo.System.User;
import com.qf.shopping.vo.UserVO;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import sun.security.provider.MD5;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Controller
public class PostManControll {

    @GetMapping("/getman")
    @ResponseBody
    public List<UserVO> tolist(){

        List<UserVO> list=new ArrayList<>();
        for (int i=1;i<10;i++){
            list.add(new UserVO(i,"pmm","123"));
        }
        System.out.println(list);
        return list;
    }

    @PostMapping("/postman")
    @ResponseBody
    public UserVO post(UserVO user){
        System.out.println(user);
//        User user1=new User();
//        user1.setId(1);
//        user1.setEmail("373844670@qq.com");
//        user1.setName("裴明明");
        return user;
    }

}
